package com.zjitc.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/5/22 15:12
 * @description:
 */
public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
  /*

  // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
  public static String app_id = "2016082600316218";

  // 商户私钥，您的PKCS8格式RSA2私钥
  public static String merchant_private_key = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCDF4a54BTXOirK6vQJatwIAHpxe7wcpS8rJ6C7+HBWZhTvhwic+kCWTg/7SLY8plY01+ENz1wBaAlb/kkfKTj7PBAt9TFW368xvaYpXD3AKVklWXo4S+pnz5AVVfkkxAh06Unk2zIgKYyDQAPILsZ6I17NA8y/RroqrUnkzhRc+VBDg6nrra2PJhcnSAWau2PpKjXmmszb/nIFZdyvQSM3K5/2j2TI8xDFWDpRKiaXvASYBkavziyiio8M7l4xcHxZxvhFWEgzqLHBcd0nmxxmb5Q+H4UJlfM6V/GHw1TRUa3N0Y5wrM3VTR7ZfB5gOvBQgoi1S873X5iOJgvDQWTVAgMBAAECggEAEeqcOjk6//NuN8+GzOay7dEK6wmrOwsEeFRxLl+VEunewKHm9nVpcGF447IbXgypyY0bsCSAAZ0zckQ9wCmFJSkfWPii5qmpqxWtaQe3VNUR3v3sq1cM0WVX3uKiK3kzYq8jr0iaADVNg/6yxaBG9hhxc3mqeRX0ibKnX8Mem1oxVaMJDmHEOE98Wyp3zYlHxIUBLOx77N93r4S+w3kDffh9zsbknK4EwVY8t/0RsLzZDvG0TLcD8qzEmVTOa0Ss3hXZSRotjov2EAWsDmx2xliUxYOnE27gizjqLAKlOxR72thiqlRT86RoJk4rTf/RfpoL0Adoj/Rc/9dcg8LtoQKBgQDMAKN9X4e9ERme4YgN4e0aQOh0G/AuX3FMJoSt+yBn0RMqdyoDsh1FwP11zIU9mM1+zdb1afjeYzuy9fPqQL61/v3bnMxAav58Z3HuIxQdD0jshLMEoujgJMkXP/dE8dRzANTA8mI+mvoinFPkjfgJBMmbWvJwuo1DsBAoyRnHvQKBgQCkgWZ8IjQZMIRRyKfnQlXPZLn6Nm0z7SY2OCeDICufVS0SfEK6XCBDP0KdeFTzHnhCoWDBcPP0QSyGr9i0s98SYw25bTMYmOt4UTujGpO11eXF3+G5VPxb4I5FD6tUcli0fT1aQ0zd05CymAkcv+iov6Gmf5zGFy68NeeTQuF2+QKBgQCVY4JVtTc5hOQ2LQHs6J0wtIeFP1BLJSlaknpmzZeVbs2SM2FZA33cLs9tDDAmQ1d4nFPls4zDjfeRvfq4eGEv9WMBB3mrUq65eyc7NATuotrMGQDfTE0slsOLexQgMNdawCkMgnLfVa4G2mO04yHXuOHKGnefhX0dLDkpJNr0IQKBgQCQAqfRK7AoDQ0I+3vhO3UbZbZZkKPwvT6iYG5WoCcQCOS4NgfEVTn5JLwQVnMnkhj9W4D0Vwl5XkS4c+Bl8MDru8Mb/LiqY9RfM93dXzrICERqAR/9uqRhWiex1ZHLD38QIkM/bYMw/jDB586yWF44u+mrdDOuRkUnhpj/laEDIQKBgQC+Se8bdrXgONvOXzxnt8JQMKVhWzcaQQAa2wM3lIVkdoubDnOEmF2UXVUXurSOlKD9CipN7GjzbFmD6DhXKd/KVLTO4ROrbp+ZyVYMAu4fhe5IcOEqjYMW0ChRL5kMPtFdjsij88ZLflK1r15YHBVMLEHTaDMb2xcHVw9YnnpIxA==";

  // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
  public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgxeGueAU1zoqyur0CWrcCAB6cXu8HKUvKyegu/hwVmYU74cInPpAlk4P+0i2PKZWNNfhDc9cAWgJW/5JHyk4+zwQLfUxVt+vMb2mKVw9wClZJVl6OEvqZ8+QFVX5JMQIdOlJ5NsyICmMg0ADyC7GeiNezQPMv0a6Kq1J5M4UXPlQQ4Op662tjyYXJ0gFmrtj6So15prM2/5yBWXcr0EjNyuf9o9kyPMQxVg6USoml7wEmAZGr84sooqPDO5eMXB8Wcb4RVhIM6ixwXHdJ5scZm+UPh+FCZXzOlfxh8NU0VGtzdGOcKzN1U0e2XweYDrwUIKItUvO91+YjiYLw0Fk1QIDAQAB";
  */

  // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
  public static String app_id = "2016082600316305";

  // 商户私钥，您的PKCS8格式RSA2私钥
  public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC4WHcZh2PUTLIWHfN0jZnqQ8Uu/mniunxQ2T3s/Wjaz2RfjJQQblkHZoEZStznwGJNRAIOu4/4YUNudVgMpLN1ms3DddCNqPKA9EFAN53mQ6fKLHm/B9QQbtNfXJExkA+mSGRMJRx08Y2gYLVjOoYhWtXxo1nSiLXY3RRs1HIybneDpC88PrDsPiR9T5o6NPyms8hDaYGiCI2gFAN1sQP5xEdxC8l4nxcE1HQdEWSuBeEoowZs4TkevuUrEEP9j/z/EKst5uvf3lry/1jy0ZcFOvAjS7M11Zc5QyXff8+74STvLau0qH8fpvjnmoo+42ftvj+gnKHWrEeTNB3wM5ZHAgMBAAECggEACiEKQkPXL2Ybbu2sX94b8+xPXFqsVMHsbMDTDz+JUGSO3lUqGZEGoUp3k30ykCVZAWfYORkDOyGVA++8q80s8yxTXAcQM4hx8rX5E986dNmI0aoJ8n4qn9CHGrlKXQ/OXFOj9y8e1iojnwlRTid8ET8dfE5+c/wBCe5z3dr6f1zMlBaBMVIBqCylMg9YylbglyTKJz575EDk6u5TPo+8JXjxI3X/YvcXx5XC0aPx7n0yLW/Fg+ppvDAHoypb4winnpz8Gllq7aqmAm0EJQWeL/AbaStw/JBhrmbCDbH5cUslfptMgR8i6RUkAkM88Y98PcKhxw521KY36Bp2bIfm8QKBgQDo2dYCgd4WAQ5vTyLhLKHDMm0Oj15vet884eH+wpGGvS4Is3XgW2OcYULdgWRJ7VCef7Djigdyn8eqdyZkUiYJuVinE4zhvoSe83JVhNRthuHl0RR1koJ9Z/1mIGRkaC9TjjW3EaDYvQS4CqbSiyP3n0WKWryoeXVK2OlohYXOSQKBgQDKrCU93512AmloWf/f9loSbG3gKUx3HxJ7n5vcZiHtVT/TXS0PymB29xAH+GVnW7/OPQhkK5UOCtG0nE++cSbLKGLeZpiCVvvGTRwUavLo+WLTfXMo4QF4dJvzU51vgJUcrp1yy0sK0mLDJReao90rQmUepwojp8lA89l+ZHiADwKBgGWksYbmqctxKpvsL42brgFHQdPZQZ/oQwqQj9ZlmKD4c9/Ydtw5CIJ68nU+xkh/D3Igy1aIKjgfB0miOWARfAlCnzBPmG/yenHoU0CBezlUZ8eqPQQVsGCNxE+QVEKAOCiBK3F+gHgcCrNL8wZ1Nn4hSHncof3pBwplJX46yu4BAoGBAIKzcXDtfIZWF9QL9k9gd8XZ1yHwgDdx+mFvFPyVgNulVnvgYucEBCG0QsphDkQRjyhZg8fVs1JS99oZ0/Nk1Te+28PBNikYH1ZK9AjWz8Ae0/S/ujxqnqAn00qgaa82pPLSSQd2wvY/pyFiEk7PzhnPv5Z88rT7x3XzzBcOhAdRAoGAZF4GTomekwu/jnvN9fIRP4oC5u9AGtJBrokr11LNUtjdP3e690D4aVIe1hZm+DoLDrjlUYzDILlX3wvWY9/gz/Biks1FtvkMWd0ZAG6tVnZaq5iFexatww5juv8nPbVh3g7orY6SatSXI1DsZchYqy4AhqUrvkR9PrTKdpU3sWQ=";

  // 支付宝公钥,查看地址：[图片]https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
  public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAryo0kOO+foMCsRJyiwPEKwbniRABB9CV8B+xLdxjQM34pGfg6yk6yVssdPUnGp6enut9gYy/1y8oXkcUW3N2XVqtSypmljYZejSQRigQHsZuYgvFxF+3t7HZokC/R9aqTHuKG1rxiZK0wAdaZRPcVAKWYXv3ME/+WZ9T9URPLQyl/xnM1t2koelLG4Wa/5cM8iVBnVAeoe4r/8SEE57g+cm0u0EhlriyzU5GdDksZ7utz9sgY4Eh+wQTmKg0sPld1Ytf+1VSLwgiwlB3CCz89sMCnFrPTGr3Tu8C2iceOHbXyo5W3/1Pt2RZX8SLT+P34wGjE0BLDlAxNpfVrm3nBwIDAQAB";


  // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问++++"http://lo/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp"
  public static String notify_url ="http://localhost:8080/index.jsp";
      /*"http://localhost:8080/notify_url.jsp";*/

  // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
  public static String return_url = "http://localhost:8080/index.jsp";

  // 签名方式
  public static String sign_type = "RSA2";

  // 字符编码格式
  public static String charset = "utf-8";

  // 支付宝网关
  public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

  // 支付宝网关
  public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

  /**
   * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
   * @param sWord 要写入日志里的文本内容
   */
  public static void logResult(String sWord) {
    FileWriter writer = null;
    try {
      writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
      writer.write(sWord);
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      if (writer != null) {
        try {
          writer.close();
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
    }
  }

}
